package com.example.springboot.ytest.ytest;

public class ClassTest {
    private String s;
    private int i;
    
    public ClassTest(String s, int i) {
        super();
        this.s = s;
        this.i = i;
    }
    public String getS() {
        return s;
    }
    public void setS(String s) {
        this.s = s;
    }
    public int getI() {
        return i;
    }
    public void setI(int i) {
        this.i = i;
    }
    
    public static void main(String[] args) {
        Class<ClassTest> c = ClassTest.class;
        
        Class<? extends ClassTestSun> asSubclass = c.asSubclass(ClassTestSun.class);
        System.out.println(asSubclass.getName());
    }
}

class ClassTestSun extends ClassTest{
    
    private char c;

    public ClassTestSun(String s, int i) {
        super(s, i);
    }
    
    public static void main(String[] args) {
        Class<ClassTestSun> c = ClassTestSun.class;
        
        Class<? extends ClassTest> asSubclass = c.asSubclass(ClassTest.class);
        System.out.println(asSubclass.getName());
        System.out.println(c.getName());
        System.out.println(asSubclass==c);
    }
}
